package com.xyy.saas.payment.adapter.channel.fm.config;

import com.xyy.saas.payment.adapter.channel.fm.config.Configuration;
import com.xyy.saas.payment.util.CertFileUtil;
import org.springframework.stereotype.Service;

@Service
public class YBMSpringConfiguration extends Configuration {

    /**
     * 富民银行的开放平台地址，如下是地址列表：
     * 沙箱环境：https://opensandbox.fbank.com
     * 生产环境：https://open.fbank.com
     */
    @Override
    public String remoteAddress() {
        /**
         * 沙箱环境
         */
        // return "https://opensandbox.fbank.com";
        /**
         * 生产环境
         */
        return "https://open.fbank.com";
    }

    /**
     * 富民开放平台RSA公钥 用于加密（开放平台自己的公钥）
     */
    @Override
    public String fbankEncPubKey() {
        /**
         * 沙箱环境
         */
        // return "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp8FwaWCgFaJsTz8zJDbxMyoQNPW4lKI8W3uQL5JPctXUlvS6uBYKa0H0gZiRjlEgUmpAneLTks017drjsq+LdsEdnww1O9rZyLWh+M58V3cYeoj8oecJf6+66Kfp7/qSdRuT+3FInNzmA0PLP1Fc5zOefjuhBahYWrmIUa39zBzF3dtyxWcxNjjQzXInDkv9sGNEa2Qud0t7HC1ppGeugiUsESvGvcpGzCA7860YbvL4vlyHGmh5H5sNV0OoEwjn1FcoYnI+wb9vo3ds5HCP9JJBJbw4u6aTs4N6Ib/hLD9A5bNj2Qw+ERrqmfPejnqg63LVcD8p8M8r5TmeyBzEUQIDAQAB";
        /**
         * 生产环境
         */
        return "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtQW76P1tYkxirhJkQF5JX+iF/0L9dXz6HS0VNDfY4L2IqJeCbUqn4fx+N0/Q7JvDeeXz9rCNqn+Ix3NaQ2PKGddr4fgdfhtChqj2iRaMwAMd5BR1JMCBigUDbe6/cWdICX1wIy05JzySf7m6liyQc3jppfZC4EBAv5X/5Emw/qZpBujP5tpJzDNJS6lQktwflozWczaP6Mdk4fDAPborIHeKbnusgO235PwlRmEldYrx65eNe8X73CGazJJs2wJ10gnCQYmDcHlHiVhK7Qjq7vcspXIG13/CRUwJGwtNUi7ttmjeXooB9ct8eqOGh09wIpoBQGc6o2o8zZdI5P403QIDAQAB";
    }

    /**
     * 富民开放平台RSA公钥 用于验签
     */
    @Override
    public String fbankSignPubKey() {
        /**
         * 沙箱环境
         */
        // return "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArKOdsVd2/v6YG10T8Uh28st2u84Xel0+QPRM6x8ZkoQsWnH6yDnM+8KEMbds3Cvii6DiIGppinI0YI7YIkLn1NPwFmCNTf5z4LG2dN+TQXyGZJnLaujJ3WB4gfEt1IENzm6ymwuaHWbBbqv4URGvoaK18iZVWkFJEmJqvscXaaNtNJhrJHb11aofoDX8Q8QtpBQxCKArI0xpujrsnIgJA8SpU2/gnTVLbJP0BInZ4IuSYveZj6P0m/5yqNAM5eVIVcc1w1jUfUgep2vpcZRThJhkW172hReZs3854WoW++H3ZTDQXbrSeHHQIU3iYs5y0Llx1PDs/mPb2/k/CACuoQIDAQAB";
        /**
         * 生产环境
         */
        return "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvZnIaloWgRLG2tiWQIfIvtEDjqNvr5qlSW6gB/a8X+ZAcK9Eb27MTgn2v52a706oUPiB8eI8UWAjMt+JoprpEsILvjWH+sueicP+a/V3VuqGSbbR5VGIb3VdyvdPF2alBuxjTjwYbRLFSP1vYNmoxDrwcjV1xPGcXxvimGOMIx47/AB07GAEpXcIUWZ3hq0r5DL8KF37B7wUQEL+/J74p9nEEYYnASqS079L2pKQP7FJoDoEHVJIrFN2SD6lL6nIVWCW6vd7WigxiE2dN58TcloGIGM6Ds6MNX9giRi/7prZN/knEq5uHDSvBHAGl9Q1so34lXcY69eVUs54epo52QIDAQAB";
    }

    @Override
    public String fBankPayPubKey() {
        /**
         * 沙箱环境 和 线上环境共用
         */
        return "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC0dYM3DXkVg9q+WcNjBPWaUwKoeRMrwdE4p4F6fiztv/Ys6F5AxGCbFW5UfbtbQavMp9Rrg3+8mJ5/Lp8sjf471NFe6EvbCcVwJ63Q6fA4xVyCAE7mQdfAlpCk9WKN7Qa/HqwO/OM6JDyOyycnjnNi3f3K2tK/JbWd/SHYOSMEDQIDAQAB";
    }

    @Override
    public String fBankPayMerchantId() {
        /**
         * 沙箱环境
         */
        // return "0900001752";
        /**
         * 生产环境
         */
        return "0000769087";
    }

    @Override
    public String fBankPayMD5Key() {
        /**
         * 沙箱环境
         */
        // return "7a8c1e89e87d4fd8b00825344ea325d3";
        /**
         * 生产环境
         */
        return "b9d30baae09e4fac845a60cc1a27a6d4";
    }

    /**
     * 商户的RSA私钥
     */
    @Override
    public String privateKey() {
        return CertFileUtil.getPrivateKeyFromPfxFile(pfxFileName(), pfxPassword());
    }

    /**
     * 商户号
     */
    @Override
    public String merchantNo() {
        /**
         * 沙箱环境
         */
        // return "8808001003079104";
        /**
         * 生产环境
         */
        return "8808001031946415";
    }

    /**
     * 富民应用id，必传
     */
    @Override
    public String appId() {
        /**
         * 沙箱环境
         */
        // return "100003318417406210";
        /**
         * 生产环境
         */
        return "100003770798422493";
    }

    /**
     * 三方站点id，必传
     */
    @Override
    public String siteId() {
        /**
         * 沙箱环境
         */
        // return "100002261159137593";
        /**
         * 生产环境
         */
        return "100002569952019120";
    }

}